<%@ page language="java" contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%> 

<link rel="stylesheet" type="text/css" href="<%=path%>/style/share/style.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/style/share/kczx.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/style/share/home_style.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/style/user.css">
<!-- 头部 -->	
<%@ include file="./space_head1.jsp"%>
<!-- 导航 -->	
<%@ include file="./space_head2.jsp"%>
<script type="text/javascript" src="<%=path%>/js/jquery-1.7.0.min.js" ></script>
<script type="text/javascript" src="<%=path%>/js/share/m.js"></script>
<script type="text/javascript" src="<%=path%>/js/share/tabs.js"></script>
<script type="text/javascript" src="<%=path%>/js/home.js"></script>
<script type="text/javascript">

function addGroup(){
	 $.ajax({ url: "../group_add_page", 
	       success: function(result){
             $("#mainPageDiv").html(result);
          }
    });	
}

//点击群组名字，进入本群组详细页面
function getGroupSingle(id){
	   window.open('<%=path%>/teamgroup/query_group_main/'+id,'_blank');
}

//点击群组名字，进入本群组详细页面
function exitGroup(id){
	$.ajax({ url: "exit_group/"+id, 
	       success: function(result){
	    	   alert(result);
           }
	
       });
}
</script>
		
		 <div class="zyt_body" style="height:auto;" id="mainPageDiv">
	 
	<div class="user_body01" style="background-color:#FFFFFF;top:0px;padding-top:20px;">
		<div style="width:98%;height:30px;text-align:left;font-size:16px;font-weight:bold;"> <span>我的群组</span> 
			<a href="javascript:addGroup()"  >
				<div class="pic_top02" style="position:relative;left:0px;top:10px;float:right;background-color:#209E85;color:#EEE">
				  	 创建群组    
				</div>
			</a> 
		</div>
		<div class="groupt_div">
			<c:forEach items="${data}" var="li">
			<c:if test="${item.index % 2== 0}">
			<div class="home_qz_divl" style="left:30px;">
				<div class="home_qz_div01"> <a href="#"   onclick="getGroupSingle('${li.group_id}')">
					<div class="home_hy_div0101">
								<c:if test="${li.group_img == null}">
									<img src="<%=path%>/images/home_images/qz00.jpg"/>  
								</c:if>
								<c:if test="${li.group_img != null}">
									<img height="80px" width="80px"  src="${showImgURL}/${li.group_img}"/> 
								</c:if>
					 </div>
					</a>
					<div class="home_qz_div0102">
						<table width="360px" height="80px" align="left">
							<tr >
								<td style="font-size:14px;font-weight:bold;height:30px;width:150px;" colspan="2"> <a href="#"  onclick="getGroupSingle('${li.group_id}')"> ${li.group_nm}</a> </td>
								<td style="width:90px;"> 
								<c:if test="${li.create_id != user_id}">
									<a href="#" style="color:#e2681f" onclick="exitGroup('${li.group_id}')"> 退出群组 </a> 
								</c:if>
								</td>
							</tr>
							<tr heigh="20px">
								<td colspan="3"> ${li.group_txt} </td>
							</tr>
							<tr heigh="20px">
								<td> 创建人：${li.user_rnm} </td>
								<td style="width:240px;" colspan="2"> 创建于：<fmt:formatDate value="${li.create_dt}" pattern="yyyy-MM-dd  HH:mm:ss"/></td>
							</tr>
							<tr heigh="20px">
								<td style="width:120px;"> 成&nbsp;&nbsp;&nbsp;员：${ li.merber_cnt} </td>
								<td style="width:150px;"> 话&nbsp;&nbsp;&nbsp;题:${ li.topic_cnt} </td>
								<td style="width:90px;"> 活&nbsp;&nbsp;&nbsp;动:${ li.activity_cnt} </td>
							</tr>
						</table>
					</div>
				</div>
				<div class="home_qz_div00"> </div>
			</div>
			</c:if> 
			<c:if test="${item.index % 2 != 0}">
			<div class="home_qz_divl" style="left:80px;">
				<div class="home_qz_div01"> <a href="#" onclick="getGroupSingle('${li.group_id}')">
					<div class="home_hy_div0101"> 
					<c:if test="${li.group_img == null}">
								<img src="../images/home_images/qz00.jpg"/>  
								</c:if>
								<c:if test="${li.group_img != null}">
									<img src="${showImgURL}${li.group_img}"/> 
								</c:if>
					</div>
					</a>
					<div class="home_qz_div0102">
						<table width="360px" height="80px" align="left">
							<tr >
								<td style="font-size:14px;font-weight:bold;height:30px;width:150px;" colspan="2"> <a href="#"  onclick="getGroupSingle('${li.group_id}')"> ${li.group_nm}</a> </td>
								<td style="width:90px;"> <a href="#" style="color:#e2681f" onclick="exitGroup('${li.group_id}')"> 退出群组 </a> </td>
							</tr>
							<tr heigh="20px">
								<td colspan="3"> ${li.group_txt} </td>
							</tr>
							<tr heigh="20px">
								<td> 创建人：${li.user_rnm} </td>
								<td style="width:240px;" colspan="2"> 创建于：${li.create_dt} </td>
							</tr>
							<tr heigh="20px">
								<td style="width:120px;"> 成&nbsp;&nbsp;&nbsp;员：${ li.merber_cnt} </td>
								<td style="width:150px;"> 话&nbsp;&nbsp;&nbsp;题:${ li.topic_cnt} </td>
								<td style="width:90px;"> 活&nbsp;&nbsp;&nbsp;动:${ li.activity_cnt} </td>
							</tr>
						</table>
					</div>
				</div>
				<div class="home_qz_div00"> </div>
			</div>
			</c:if> 
			</c:forEach>
		</div>
	</div>
</div>
	 
	 <!--  结尾 -->
	 <%@ include file="../all_buttom.jsp"%>
	 
 </body>
</html>